home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96a.txt / 000066_icon-group-sender _Thu Mar 7 08:53:52 1996.msg < prev    next >
Internet Message Format  |  1996-09-05  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Thu, 7 Mar 1996 13:07:36 MST
  2. To: icon-group@cs.arizona.edu
  3. Date: Thu, 07 Mar 1996 08:53:52 -0700
  4. From: Steve Wampler <swampler@gemini.edu>
  5. Message-Id: <313F0690.6BBD@gemini.edu>
  6. Organization: Gemini 8m Telescopes Project
  7. Sender: icon-group-request@cs.arizona.edu
  8. Subject: 'right-handed' operators
  9. Errors-To: icon-group-errors@cs.arizona.edu
  10. Status: O
  11.  
  12. I'm not I'd be in favor of adding any more operators to Icon, which
  13. has already taken more than its share.  Why not just use the following
  14. for those (hopefully rare) cases where the right-hand side value is 
  15. needed:
  16.  
  17.      rhsv("<",e1,e2)
  18.  
  19. where rhsv is:
  20.  
  21. procedure rhsv(op, l, r)
  22.  
  23.     return if op(l,r) then r
  24.  
  25. end
  26.  
  27. You could even eliminate the first argument if you wanted to write
  28. operator-specific versions:
  29.  
  30. procedure rhlt(l,r)
  31.     return if l<r then r
  32. end
  33.  
  34. -- 
  35.  
  36. Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under
  37. AURA)]
  38. The Gods that smiled upon your birth are laughing now. -- fortune cookie
  39.